var e;

e = require("../../05BFE3A3C6098CCF63D98BA434E9C3F4.js")(require("../../9D53CC23C6098CCFFB35A4246909C3F4.js")), 
getApp(), Page({
    data: {
        keywords: "",
        loadingDH: !0,
        home_keywords: [],
        list: []
    },
    onLoad: function(e) {
        e.keywords || wx.reLaunch({
            url: "/pages/home/home"
        });
        var t = wx.getStorageSync("home_keywords");
        t.unshift("全部", "热门", "最新", "名称"), this.setData({
            keywords: e.keywords,
            home_keywords: t
        }), this.getHeji();
    },
    detail: function(e) {
        var t = e.currentTarget.dataset.id, o = e.currentTarget.dataset.item;
        1 == o && wx.navigateTo({
            url: "/pages/index/index?id=" + t
        }), 2 == o && wx.navigateTo({
            url: "/pages/gua/gua?id=" + t
        });
    },
    selKey: function(e) {
        console.log(e);
        var t = this.data.home_keywords[e.currentTarget.dataset.index];
        this.setData({
            keywords: t
        }), this.getHeji("加载中...", "loading");
    },
    getHeji: function() {
        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", n = this;
        e.default.postRequest("/api/Index/heji", {
            keywords: n.data.keywords
        }, t, o, function(e) {
            n.setData({
                list: e.data.data,
                loadingDH: !1
            });
        }, function(e) {
            wx.showToast({
                title: "请求失败",
                icon: "none",
                duration: 3e3
            });
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});